<jsp:useBean id="bean" class="phylacterium.beans.AccountBean" scope="request" />
<%@ include file="header.jspf" %>
<form action="account" method="post">
<table>
	<tr>
		<td align="right"><b>Login</b></td>
		<td><input type="text" name="login" <%= bean.writeLogin() %> style="width: 150px" readonly></input></td>
		<td><font color="red"><b><%= bean.loginError %></b></font></td>
	</tr>
	<tr>
		<td align="right"><b>Old password</b></td>
		<td><input type="password" name="password" style="width: 150px"/></td>
		<td><font color="red"><b><%= bean.passwordError %></b></font></td>
	</tr>
	<tr>
		<td align="right"><b>New password</b></td>
		<td><input type="password" name="newPassword" style="width: 150px"/></td>
		<td><font color="red"><b><%= bean.newPasswordError %></b></font></td>
	</tr>
	<tr>
		<td align="right"><b>Confirm new password</b></td>
		<td><input type="password" name="confirmNewPassword" style="width: 150px"/></td>
	</tr>
	<tr>
		<td align="right">Name</td>
		<td><input type="text" name="name" <%= bean.writeName() %> style="width: 150px"/></td>
	</tr>
	<tr>
		<td align="right">Age</td>
		<td>
			<input type="text" name="age" size="1" <%= bean.writeAge() %> style="width: 75px">
		</td>
		<td><font color="red"><b><%= bean.ageError %></b></font></td>
	</tr>
	<tr>
		<td align="right">Gender</td>
		<td>
			<select name="gender" size="1" style="width: 75px">
				<option value="n"></option>
				<option value="M" <%= bean.writeGender('M') %>>Male</option>
				<option value="F" <%= bean.writeGender('F') %>>Female</option>
			</select>
		</td>
	</tr>
	<tr>
		<td align="right">Education</td>
		<td>
			<select name="education" size="1" style="width: 150px">
				<option value="0"></option>
				<%for (String[] row : bean.education){%>
					<option value=<%= row[0] %> <%= bean.writeEducation(Integer.parseInt(row[0])) %>><%= row[1] %></option>
				<% } %>
			</select>	
		</td>
	</tr>
	<tr>
		<td align="right">Favourite genre</td>
		<td>
			<select name="genre" size="1" style="width: 150px">
				<option value="0"></option>
				<%for (String[] row : bean.genres){%>
					<option value=<%= row[0] %> <%= bean.writeGenre(Integer.parseInt(row[0])) %>><%= row[1] %></option>
				<% } %>
			</select>	
		</td>	
	</tr>
	<tr>
		<td></td>
		<td><input type="submit" name="update" value="Update account" /></td>
		<td><font color="green"><b><%= bean.updateStatus %></b></font></td>
	</tr>	
</table>
</form>
<%@ include file="footer.jspf" %> 